package com.example.mysql_mybatis_demo.aForTest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SubscribeListener {

    @Autowired(required = false)
    private void justFind(List<TopListener> topListeners){
        topListeners.forEach(this::justPrint);
    }

    public void justPrint(TopListener topListener){
        System.out.println("Subscribe发现:" + topListener.getClass());
    }
}
